/**
 * Created by commy on 2015/5/1.
 */
var Q = require('q');
var a = [1,2];
Q.all(a.map(function(number){
    var deferred = Q.defer();
    setTimeout(function(){
        deferred.resolve(1);
    },100);
    return deferred.promise;
})).then(function(results){
    console.log(arguments);
})